package com.example.zhuma.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

import com.example.zhuma.R;

import java.util.List;
import java.util.Map;

public class VoiceMessageAdapter extends BaseAdapter {
    List<Map<String,Object>> myData;
    public VoiceMessageAdapter(List<Map<String,Object>> data){
        this.myData = data;
    }

    //通知ListView渲染数据长度
    @Override
    public int getCount() {
        return myData.size();
    }

    //用于获取每行数据的
    @Override
    public Object getItem(int position) {
        return myData.get(position);
    }

    //每一行的唯一标识
    @Override
    public long getItemId(int position) {
        return position;
    }

    /*
    * 用于渲染每一行的视图
    * position代表某一行
    * convert代表上一次渲染的视图
    * parent就是listView
    * */
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
//        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
//        View v;
//        if (convertView == null){
//            //使用XML渲染一个组件
//            v= inflater.inflate(R.layout.activity_msg_left,parent,false);
//        }
//        else {
//            v=convertView;
//        }

        return null;
    }
}
